<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>時鐘</title>
	</head>
	<body>
		<h4>您好，歡迎訪問貴美商城</h4>
		<div id="myclock"></div>
		<script type="text/javascript">
			function time(){
			var today=new Date();
			var year=today.getFullYear();
			var month=today.getMonth();
			var day=today.getDate();
			var hh=today.getHours();
			var mm=today.getMinutes();
			var ss=today.getSeconds();
			var xq=today.getDay()
			if(hh>12){
				document.getElementById("myclock").innerHTML=
				year+"年"+(month+1)+"月"+day+"日"+""+hh+":"+mm+":"+ss+""+"PM"+""+""+xq;
			}else{
				document.getElementById("myclock").innerHTML=
				year+"年"+(month+1)+"月"+day+"日"+""+hh+":"+mm+":"+ss+""+"AM"+""+""+xq;
			}
			}
			var mytime=setInterval("time();",1000);
		</script>
	</body>
</html>
